﻿using Albatross.WPF.Common.ViewModels;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Controls;

namespace Albatross.WPF.Common {
	public class ViewOnlyWorkspaceConstruct<T> : IWorkspaceConstruct where T : UserControl, new() {

		public ViewOnlyWorkspaceConstruct(string title) {
			Constructed = new WorkspaceViewModel() { Title = title };
			KeepAlive = false;
		}

		public Type ViewModelType {
			get { return typeof(WorkspaceViewModel); }
		}

		public object[] Args { get; set; }

		public IWorkspaceViewModel Constructed { get; private set; }

		public string Region { get; set; }

		public object WorkspaceID { get; set; }

		public bool KeepAlive { get; set; }

		public IWorkspaceViewModel Build() { return Constructed; }

		public System.Windows.Controls.UserControl GetView() {
			return new T();
		}


		public Type ViewType { get { return typeof(T); } }
	}
}
